package com.agileboot.attendance.domain.settlement.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * 结算单状态枚举
 */
@Getter
public enum SettlementStatus {
    
    DRAFT(0, "草稿"),
    PENDING_PARTY_B_REVIEW(1, "待乙方审核"),
    PARTY_B_APPROVED(2, "乙方审核通过"),
    PARTY_B_REJECTED(3, "乙方审核不通过"),
    PENDING_PARTY_A_REVIEW(4, "待甲方审核"),
    PARTY_A_APPROVED(5, "甲方审核通过"),
    PARTY_A_REJECTED(6, "甲方审核不通过");

    @EnumValue
    private final int value;
    private final String label;

    SettlementStatus(int value, String label) {
        this.value = value;
        this.label = label;
    }

    public static SettlementStatus fromValue(int value) {
        for (SettlementStatus status : SettlementStatus.values()) {
            if (status.getValue() == value) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid SettlementStatus value: " + value);
    }
} 